home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / PowerPlant / CKT AGA 1.0 / LSecondaryGroupBox.cp < prev    next >
Encoding:
Text File  |  1996-05-09  |  1.8 KB  |  107 lines  |  [TEXT/CWIE]

  1. /*
  2.     File:        LSecondaryGroupBox.cp
  3.  
  4.     Contains:    Contains:    Apple Grayscale Appearance-savvy 
  5.                 secondary group box pane.
  6.  
  7.     Copyright:    ©1996 Chris K. Thomas.  All Rights Reserved.
  8.  
  9.     Version:    1.0
  10. */
  11.  
  12. #include "LSecondaryGroupBox.h"
  13. #include "AGAColors.h"
  14.  
  15.  
  16. //
  17. // • instance lifetime —————————————————————————————————————————————————————————————————————————
  18. //
  19.  
  20. LSecondaryGroupBox*
  21. LSecondaryGroupBox::CreateSecondaryGroupBoxStream(LStream *inStream)
  22. {
  23.     return new LSecondaryGroupBox(inStream);
  24. }
  25.  
  26.  
  27. LSecondaryGroupBox::LSecondaryGroupBox()
  28. {
  29.  
  30. }
  31.  
  32.  
  33. LSecondaryGroupBox::LSecondaryGroupBox( const LGroupBox &inGroupBox)
  34. :LGroupBox(inGroupBox)
  35. {
  36.  
  37. }
  38.  
  39.  
  40. LSecondaryGroupBox::LSecondaryGroupBox( const SPaneInfo &inPaneInfo, Str255 inString, ResIDT inTextTraitsID)
  41. :LGroupBox(inPaneInfo, inString, inTextTraitsID)
  42. {
  43.  
  44. }
  45.  
  46.  
  47. LSecondaryGroupBox::LSecondaryGroupBox( LStream *inStream)
  48. :LGroupBox(inStream)
  49. {
  50.  
  51. }
  52.  
  53. //
  54. // • imaging ———————————————————————————————————————————————————————————————————————————————————
  55. //
  56.  
  57. void
  58. LSecondaryGroupBox::DrawText(
  59.     const Rect        &inRect)
  60. {
  61.     if(!IsEnabled())
  62.         ::RGBForeColor(&kColor7);
  63.     else
  64.         ::RGBForeColor(&kBlackColor);
  65.         
  66.     LGroupBox::DrawText(inRect);
  67. }
  68.  
  69.  
  70. void
  71. LSecondaryGroupBox::DrawBorder( const Rect &inRect)
  72. {
  73.     const RGBColor    *darkColor;
  74.     const RGBColor    *lightColor;
  75.     Rect            r = inRect;
  76.     
  77.     if(IsEnabled())
  78.     {
  79.         darkColor = &kColor7;
  80.         lightColor = &kWhiteColor;
  81.     }
  82.     else
  83.     {
  84.         darkColor = &kColor4;
  85.         lightColor = &kColor1;
  86.     }
  87.     
  88.     //
  89.     // draw dark bits
  90.     //
  91.     ::RGBForeColor(darkColor);
  92.     
  93.     MoveTo(inRect.left, inRect.bottom - 1);    // left
  94.     LineTo(inRect.left, inRect.top);
  95.     LineTo(inRect.right - 1, inRect.top);        // top
  96.     
  97.     //
  98.     // draw light bits
  99.     //
  100.     ::RGBForeColor(lightColor);
  101.     
  102.     MoveTo(inRect.right, inRect.top + 1);    // right
  103.     LineTo(inRect.right, inRect.bottom);
  104.     LineTo(inRect.left + 1, inRect.bottom);        // bottom
  105. }
  106.  
  107.